package info.nixbear.tgcms.admin.client.view;

import info.nixbear.tgcms.admin.client.activity.RedirectEditActivity;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class RedirectEditView extends Composite {

	private static RedirectEditViewUiBinder uiBinder = GWT
			.create(RedirectEditViewUiBinder.class);

	interface RedirectEditViewUiBinder extends
			UiBinder<Widget, RedirectEditView> {
	}

	public RedirectEditView() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	
	RedirectEditActivity redirectEditActivity;

	@UiField RedirectEditor editor;
	@UiField Button save;
	@UiField Button cancel;


	@UiHandler(value={"cancel","back"})
	void onCancel(ClickEvent event) {
		this.redirectEditActivity.onCancel(event);
	}
	
	@UiHandler("save")
	void onSave(ClickEvent event) {
		this.redirectEditActivity.onSave(event);
	}

	public RedirectEditor getEditor() {
		return editor;
	}

	public RedirectEditActivity getRedirectEditActivity() {
		return redirectEditActivity;
	}

	public void setRedirectEditActivity(RedirectEditActivity redirectEditActivity) {
		this.redirectEditActivity = redirectEditActivity;
	}


	
}
